const mysql = require('mysql');
const querySql = (sql, sqlParam, callback) => {
    var connection = mysql.createConnection({
        host: 'localhost',
        user: 'root',
        password: '123456',
        port: '3306',
        database: 'book'
    });
    connection.connect();
    connection.query(sql, sqlParam, function(err, result) {
        if (err) {
            console.log("------------err:", err);
        }
        callback(err, result)
    });
    connection.end();
}
exports.querySql = querySql